import tool from './common/tool'
import { getStorageSync, setStorage } from './common/storage'

const {
  makeid
} = tool
export default class {
  onLaunch() {
    const storeOpenid = getStorageSync('openid')
    if (storeOpenid) {
      global.openid = storeOpenid
    } else {
      global.openid = makeid()
      setStorage({
        key: 'openid',
        data: global.openid
      })
    }
  }
}
